#include <iostream>
// 函数签名(signature) = 函数名 + 参数列表，不包括返回值类型和参数名称
// int abc(int a, int b, int c) : abc(int, int, int)

// 抛出异常throw 处理异常catch 
int abc(int a, int b, int c)
{
    if (a <= 0 || b <= 0 || c <= 0)
        // throw (char*)"All arguments must be positive integers."; // char* 的字符串常量
        throw "All arguments must be positive integers."; // const char* 的字符串常量
    return a + b + c;
}

template<class T, std::size_t N>
std::size_t array_size(const T(&)[N])
{
    return N;
}
int main()
{
    int arr[5];
    std::cout << array_size(arr) << std::endl;
    int a = 1, b = 2, c = 0;
    try {
        std::cout << abc(a, b, c) << std::endl;
    }
    catch (char* e) {
        std::cout << "char* error : " << e << std::endl;
        return 1;
    }
    catch (const char* e) {
        std::cout << "const char* error: " << e << std::endl;
        return 1;
    }
    return 0;
}